home *** CD-ROM | disk | FTP | other *** search
- #include <exec/types.h>
- #include <exec/exec.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include "work:romconf/doorheader.h"
- #define gu getuserstring
- #define pm prompt
- #define hk hotkey
- #define sm sendmessage
- char cmd[200];
- void showbull(char *str);
- void end();
- main(int argc, char *argv[])
- {
- FILE *fi;
- char respond[10];
- char filename[200];
- char nodelocal[200];
- char conflocal[200];
- char bbsloc[50];
- int Bconf=0,Bnode=0;
- int node;
- Register(argv[1][0]-'0');
- node = argv[1][0]-'0';
- gu(cmd,BB_CONFLOCAL);
- gu(bbsloc,BB_LOCAL);
-
- sprintf(filename,"%sNode%d/Bulletins/",bbsloc,node);
- strcpy(nodelocal,filename);
-
- sprintf(filename,"%sBulletins/",cmd);
- strcpy(conflocal,filename);
-
- strcpy(filename,nodelocal);
- strcat(filename,"bullhelp.txt");
- fi=fopen(filename,"r");
- if(fi!=NULL) { fclose(fi); Bnode=1; }
-
- strcpy(filename,conflocal);
- strcat(filename,"bullhelp.txt");
- fi=fopen(filename,"r");
- if(fi!=NULL) { Bconf=1; fclose(fi); }
- sm("",1);
- while(1)
- {
- if(Bnode==1 && Bconf==1)
- {
- sm("Please enter bulletin type N)ode or C)onference or {return=exit}>:",0);
- hk("",cmd);
- if(cmd[0]<' ') { sm("",1);sm("",1);ShutDown(); end(); }
- if(cmd[0]=='N' || cmd[0]=='n')
- {
- sm("Node.",1);
- showbull(nodelocal);
- }
- if(cmd[0]=='C' || cmd[0]=='c')
- {
- sm("conference.",1);
- showbull(conflocal);
- }
- }
- if(Bnode==0 && Bconf==1)
- {
- showbull(conflocal);
- }
- if(Bnode==1 && Bconf==0)
- {
- showbull(nodelocal);
- }
- if(Bnode==0 && Bconf==0)
- {
- sm("Sorry, we have no bulletins",1);
- sm("",1);
- ShutDown(); end();
- }
- }
- }
-
- void showbull(char *str)
- {
- char string[200];
- char cmd[200];
- FILE *fi;
- int num;
- strcpy(string,str);
- strcat(string,"BullHelp");
- showgfile(string);
-
- while(1)
- {
- sm("",1);
- sm("Type '?' {RETURN} to view menu",1);
- pm("Enter bulletin number you wish to view or {RETURN to exit} >:",cmd,5);
- num=atoi(cmd);
- if(cmd[0]=='?')
- {
- strcpy(string,str);strcat(string,"BullHelp");
- showgfile(string);
- continue;
- }
- sm("",1);
- if(num==0){ sm("",1); ShutDown(); end(); }
- sprintf(string,"%sBull%d.txt",str,num);
- fi=fopen(string,"r");
- if(fi==NULL)
- {
- sm("",1);
- sm("Sorry, can't locate that Bulletin",1);
- continue;
- }
- fclose(fi);
- sprintf(string,"%sBull%d",str,num);
- showgfile(string);
- }
-
- }
-
- void end()
- {
- exit(0);
- }